package it.antonio.ilpizze.ioc;

import java.util.List;

public class InstanceDecorator {
	
	private Class<? extends Object> type;
	private List<Decoration<? super Object>> decorations;

	public InstanceDecorator(Class<? extends Object> type, List<Decoration<? super Object>> decorations) {
		this.type = type;
		this.decorations = decorations;
	}

	public Class<?> getType() {
		return type;
	}

	public void decorate(Object instance, Dependencies dependencies) {
		for (Decoration<Object> decoration : decorations) {
			decoration.decorate(instance, dependencies);
		}
	}
}
